package org.vectrics.recruiter.struts.tag;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.vectrics.recruiter.RecruitServiceLocator;
import org.vectrics.recruiter.job.JobSearchCriteria;
import org.vectrics.common.pagelist.PageList;


/**
 */
public class JobPageList extends PageList {
	private transient static Log log = LogFactory.getLog(JobPageList.class);
	//private List jobIds = null;
	//private JobCriteria criteria = null;
	
	public JobPageList(JobSearchCriteria criteria) {
		super();
		this.setCriteria(criteria);
	}

	public List getElements(int startIndex, int endIndex) {
		List elements = RecruitServiceLocator.getJobProvider().findJobs((JobSearchCriteria)this.getCriteria(), startIndex, endIndex);
		return(elements);
	}


	public int getTotalElementCount() {
		log.debug("getTotalElementCount()");
		int size = RecruitServiceLocator.getJobProvider().findJobCount((JobSearchCriteria)this.getCriteria());
		return(size);
	}


}
